
var page = sm("do_Page");
var app = sm("do_App");
var nf = sm("do_Notification");
var listdata = mm("do_ListData");
var initdata = sm("do_InitData");
var global = sm("do_Global");
//获取token
var cacher = sm("do_DataCache");
var token  = cacher.loadData("token");

//物理返回键
page.on("back", function(data) {
	app.closePage();
});

var do_listview_assistant = ui("do_listview_assistant");


do_listview_assistant.bindItems(listdata);// 建立ListView 与 ListData 的行数据关系;

initdata.readFile("initdata://assistant.json", function(data){// 读取文件
	
    listdata.addData(data); // 给ListData添加数据
    do_listview_assistant.refreshItems(); // 刷新ListView 行数据;
});
do_listview_assistant.rebound();


do_listview_assistant.on("touch",function(data, e){
	global.setMemory("key1","source://image/listview/4.png");
	global.setMemory("key2","支付助手");
	global.setMemory("key3","2017-10-31 19:09:00");
	global.setMemory("key4","+ ￥ 20");
	global.setMemory("key5","王大锤扫支付宝支付");
	app.openPage({source:"source://view/main/assistantdeatails.ui", data:data}, function(data, e){
		//app.openPage({source:"source://view/ui/listviewdemo.ui", data:data, animationType:"", isFullScreen:false, keyboardMode:"default", scriptType:""}, function(data, e){});
		data.set("assistant","支付助手");
		
	});
});






var do_Button_Consumption = ui("do_Button_Consumption");
var do_Button_Storedvalue = ui("do_Button_Storedvalue");
var do_Button_Coupons = ui("do_Button_Coupons");
var do_Button_Sign = ui("do_Button_Sign");
var do_Button_news = ui("do_Button_news");
var do_Button_Monthlyreport = ui("do_Button_Monthlyreport");

do_Button_Consumption.on("touch", function() {
	app.openPage("source://view/Consumption/Consumption.ui");
});
do_Button_Storedvalue.on("touch", function() {
	app.openPage("source://view/storedvalue/storedvalue.ui");
});
do_Button_Coupons.on("touch", function() {
	app.openPage("source://view/Consumption/SweepCodePayment.ui");
});
do_Button_Sign.on("touch", function() {
	app.openPage("source://view/sign/sign.ui");
});
do_Button_news.on("touch", function() {
	app.openPage("source://view/news/do_listview.ui");
});
do_Button_Monthlyreport.on("touch", function(data,e ) {
	var data1 =["monthlyreport"];
	app.openPage({source:"source://view/index.ui", data:data1, animationType:"", isFullScreen:false, keyboardMode:"default", scriptType:""}, function(data, e){});

});